<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/Decider802154Narrow.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00462.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Decider802154Narrow.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Decider80211.h</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *  Created on: 11.02.2009</span>
<a name="l00005"></a>00005 <span class="comment"> *      Author: karl wessel</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef DECIDER802154NARROW_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define DECIDER802154NARROW_H_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;MiXiMDefs.h&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;BaseDecider.h&quot;</span>
<a name="l00013"></a>00013 
<a name="l00021"></a><a class="code" href="a00074.html">00021</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00074.html" title="Decider for the 802.15.4 Narrow band module.">Decider802154Narrow</a>: <span class="keyword">public</span> <a class="code" href="a00020.html" title="Provides some base functionality for most common deciders.">BaseDecider</a> {
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00023"></a>00023   <span class="keyword">enum</span> Decider802154NarrowControlKinds {
<a name="l00024"></a>00024     RECEPTION_STARTED=<a class="code" href="a00020.html#a7232c10b806ef074db6b1452664cc4a2a1944cc67bf3f0c98342e3975bd05021c" title="Sub-classing decider should begin their own kinds at this value.">LAST_BASE_DECIDER_CONTROL_KIND</a>,
<a name="l00025"></a>00025     LAST_DECIDER802154NARROW_CONTROL_KIND
<a name="l00026"></a>00026   };
<a name="l00027"></a>00027 <span class="keyword">protected</span>:
<a name="l00029"></a><a class="code" href="a00074.html#ade4807869cec17ce6b03c500c1dc3670">00029</a>   <span class="keywordtype">int</span> <a class="code" href="a00074.html#ade4807869cec17ce6b03c500c1dc3670" title="Start Frame Delimiter length in bits.">sfdLength</a>;
<a name="l00030"></a>00030 
<a name="l00034"></a><a class="code" href="a00074.html#a698238eb8a43edf264671ba779a8d7ee">00034</a>   <span class="keywordtype">double</span> <a class="code" href="a00074.html#a698238eb8a43edf264671ba779a8d7ee" title="Minimum bit error rate. If SNIR is high, computed ber could be higher than maximum radio performance...">BER_LOWER_BOUND</a>;
<a name="l00035"></a>00035 
<a name="l00037"></a><a class="code" href="a00074.html#ad8fd46766da41740d657b82f7f55cffe">00037</a>   std::string <a class="code" href="a00074.html#ad8fd46766da41740d657b82f7f55cffe" title="modulation type">modulation</a>;
<a name="l00038"></a>00038 
<a name="l00040"></a><a class="code" href="a00074.html#a16aeca5b7582880d749da898cb262b5f">00040</a>   cOutVector <a class="code" href="a00074.html#a16aeca5b7582880d749da898cb262b5f">snirDropped</a>;
<a name="l00041"></a>00041 
<a name="l00043"></a><a class="code" href="a00074.html#ac91b420188aaaed238a031fe8e86ac94">00043</a>   <span class="keyword">mutable</span> cOutVector <a class="code" href="a00074.html#ac91b420188aaaed238a031fe8e86ac94">snirReceived</a>;
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 
<a name="l00047"></a><a class="code" href="a00074.html#a4080fb55ed0c343ab361117f1534b645">00047</a>   <span class="keyword">mutable</span> cOutVector <a class="code" href="a00074.html#a4080fb55ed0c343ab361117f1534b645">snrlog</a>;
<a name="l00048"></a>00048 
<a name="l00050"></a><a class="code" href="a00074.html#a065631e945194ba68f05fbd9fcfcc308">00050</a>   <span class="keyword">mutable</span> cOutVector <a class="code" href="a00074.html#a065631e945194ba68f05fbd9fcfcc308">berlog</a>;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">protected</span>:
<a name="l00059"></a><a class="code" href="a00074.html#a122afffb9bc9be41d382a81a5b222603">00059</a>   <span class="keyword">virtual</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa" title="The current state of processing for a signal.">eSignalState</a> <a class="code" href="a00074.html#a122afffb9bc9be41d382a81a5b222603" title="Returns the next signal state (END, HEADER, NEW).">getNextSignalState</a>(<a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaa" title="The current state of processing for a signal.">eSignalState</a> CurState)<span class="keyword"> const </span>{
<a name="l00060"></a>00060     <span class="keywordflow">switch</span>(CurState) {
<a name="l00061"></a>00061       <span class="keywordflow">case</span> NEW:           <span class="keywordflow">return</span> <a class="code" href="a00020.html#a66b8c7b730a6169202fdb36263b74aaaaf0a66719215a9be8335546666facaab6" title="Waiting for the header of the signal.">EXPECT_HEADER</a>;                             <span class="keywordflow">break</span>;
<a name="l00062"></a>00062       <span class="keywordflow">default</span>:            <span class="keywordflow">return</span> <a class="code" href="a00020.html#a4a8ddbaf158b593d4aabeac39c1d36ad" title="Returns the next signal state (END, HEADER, NEW).">BaseDecider::getNextSignalState</a>(CurState); <span class="keywordflow">break</span>;
<a name="l00063"></a>00063     }
<a name="l00064"></a>00064     <span class="keywordflow">return</span> <a class="code" href="a00020.html#a4a8ddbaf158b593d4aabeac39c1d36ad" title="Returns the next signal state (END, HEADER, NEW).">BaseDecider::getNextSignalState</a>(CurState);
<a name="l00065"></a>00065   }
<a name="l00066"></a>00066 
<a name="l00067"></a>00067   <span class="keyword">virtual</span> simtime_t <a class="code" href="a00020.html#ab53849078ba0481ea80a8926bdedd5f0" title="Processes the end of the header of a received Signal.">processSignalHeader</a>(airframe_ptr_t frame);
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00075"></a>00075   <span class="keyword">virtual</span> <a class="code" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a>* <a class="code" href="a00020.html#ac6ef3a4cf1b91bcec788b540d61bfeba" title="Creates the DeciderResult from frame.">createResult</a>(<span class="keyword">const</span> airframe_ptr_t frame) <span class="keyword">const</span>;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   <span class="keywordtype">double</span> getBERFromSNR(<span class="keywordtype">double</span> snr) <span class="keyword">const</span>;
<a name="l00078"></a>00078 
<a name="l00079"></a>00079   <span class="keywordtype">bool</span>   syncOnSFD(airframe_ptr_t frame) <span class="keyword">const</span>;
<a name="l00080"></a>00080 
<a name="l00081"></a>00081   <span class="keywordtype">double</span> evalBER(airframe_ptr_t frame) <span class="keyword">const</span>;
<a name="l00082"></a>00082 
<a name="l00083"></a>00083   <span class="keywordtype">bool</span> recordStats;
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="keyword">public</span>:
<a name="l00086"></a>00086 
<a name="l00088"></a>00088   <span class="keyword">static</span> <span class="keywordtype">double</span> n_choose_k(<span class="keywordtype">int</span> n, <span class="keywordtype">int</span> k);
<a name="l00089"></a>00089 
<a name="l00092"></a><a class="code" href="a00074.html#a0f0783dd408329b1ffc7385b99678af2">00092</a>   <a class="code" href="a00074.html" title="Decider for the 802.15.4 Narrow band module.">Decider802154Narrow</a>( <a class="code" href="a00079.html" title="This class is the interface for a Decider to the BasePhyLayer.">DeciderToPhyInterface</a>* phy
<a name="l00093"></a>00093                      , <span class="keywordtype">double</span>                 sensitivity
<a name="l00094"></a>00094                      , <span class="keywordtype">int</span>                    myIndex
<a name="l00095"></a>00095                      , <span class="keywordtype">bool</span>                   debug )
<a name="l00096"></a>00096       : <a class="code" href="a00020.html" title="Provides some base functionality for most common deciders.">BaseDecider</a>(phy, sensitivity, myIndex, debug)
<a name="l00097"></a>00097       , sfdLength(0)
<a name="l00098"></a>00098       , BER_LOWER_BOUND(0)
<a name="l00099"></a>00099       , modulation(<span class="stringliteral">&quot;&quot;</span>)
<a name="l00100"></a>00100       , snirDropped()
<a name="l00101"></a>00101       , snirReceived()
<a name="l00102"></a>00102       , snrlog()
<a name="l00103"></a>00103       , berlog()
<a name="l00104"></a>00104       , recordStats(false)
<a name="l00105"></a>00105   {
<a name="l00106"></a>00106     snirDropped.setName(<span class="stringliteral">&quot;snirDropped&quot;</span>);
<a name="l00107"></a>00107     snirReceived.setName(<span class="stringliteral">&quot;snirReceived&quot;</span>);
<a name="l00108"></a>00108     berlog.setName(<span class="stringliteral">&quot;berlog&quot;</span>);
<a name="l00109"></a>00109     snrlog.setName(<span class="stringliteral">&quot;snrlog&quot;</span>);
<a name="l00110"></a>00110   }
<a name="l00111"></a>00111 
<a name="l00120"></a>00120   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="a00070.html#ae19a201633e5b2bf2d545921049b4f26" title="Initialize the decider from XML map data.">initFromMap</a>(<span class="keyword">const</span> ParameterMap&amp; params);
<a name="l00121"></a>00121 
<a name="l00122"></a>00122   <span class="keyword">virtual</span> ~<a class="code" href="a00074.html" title="Decider for the 802.15.4 Narrow band module.">Decider802154Narrow</a>() {};
<a name="l00123"></a>00123 };
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 <span class="preprocessor">#endif </span><span class="comment">/* DECIDER80211_H_ */</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>Decider802154Narrow.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:30 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
